package com.lefu.risk.storm.bolt;

import java.util.Map;

import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichBolt;
import org.apache.storm.tuple.Tuple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Abolt extends BaseRichBolt{
	
//	private Logger logger = LoggerFactory.getLogger(Abolt.class);

	private static final long serialVersionUID = 1L;
	
	private OutputCollector collector;

	private int taskId ;
	
	@Override
	public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
		this.collector = collector;
		taskId = context.getThisTaskId();
	}

	@Override
	public void execute(Tuple input) {
		String word = input.getString(0);
		//logger.info();
		System.err.println(word + " + BoltID "+ taskId);
	}

	@Override
	public void declareOutputFields(OutputFieldsDeclarer declarer) {
		
	}

}
